package com.lagou.server;

import com.lagou.model.ExamMessage;
import com.lagou.model.User;

import java.util.List;

/**
 * 数据存取
 */

public class ServerDao {

    /**
     * 编程实现管理员账号和密码以及题目答案是否正确的校验并将结果返回出去
     * @param user
     * @return
     */
    public boolean serverMangerCheck(User user){
        if("admin".equals(user.getUserName()) && "123456".equals(user.getPassword())){
            return true;
        }
        return false;
    }
    public boolean serverStudentCheck(User user, List<User> list){
        boolean flag = false;
        for (User u : list) {
            if(u.getUserName().equals(user.getUserName()) && u.getPassword().equals(user.getPassword())){
                flag = true;
            }
        }
        return flag;
    }

}
